package assfur.eran.utils;

import com.google.gson.Gson;

public class GsonUtils {
    private static GsonUtils ourInstance = new GsonUtils();
    private Gson mGson;

    private GsonUtils() {
        mGson = new Gson();
    }

    public static GsonUtils getInstance() {
        return ourInstance;
    }

    public Gson getGson() {
        return mGson;
    }

    public <T> T getJsonObjectFromFile(String _filePath, Class<T> _classOfT) {
        T returnObj = getGson().fromJson(FileUtils.readStringFromFile(_filePath), _classOfT);
        return returnObj;
    }
}
